package com.tuniu.agents.tool;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation is used to define environment parameters.
 */
@Target({ElementType.FIELD, ElementType.RECORD_COMPONENT})
@Retention(RetentionPolicy.RUNTIME)
public @interface EnvParam {

    /**
     * Parameter name, which is the KEY in the global variable ENV.
     * @return the name of the parameter
     */
    String value();

    /**
     * Regular expression pattern that must be matched to overwrite back to ENV.
     * @return the regex pattern
     */
    String pattern() default "";

    /**
     * Indicates whether it needs to be overwritten back to ENV.
     * @return true if it should be set back to ENV, false otherwise
     */
    boolean setEnv() default true;

}
